package com.project.service.impl;

import com.project.bean.CarBean;
import com.project.mapper.ICarMapper;
import com.project.service.ICarService;

import java.util.List;

public class CarServiceImpl extends BaseService implements ICarService {
    @Override
    public void add(CarBean car,int manId) {
        ICarMapper mapper2 = session.getMapper(ICarMapper.class);
        mapper2.add(car,manId);
        this.commitAndClose();
    }

    @Override
    public List<CarBean> findAll(int id) {
        ICarMapper mapper2 = session.getMapper(ICarMapper.class);
        List<CarBean> list =  mapper2.findAll(id);
        this.commitAndClose();
        return list;
    }
    public static void main(String[] args){
        ICarService service = new CarServiceImpl();
//        service.add(new CarBean("qiqiqi",11000),3);
        System.out.println(service.findAll(3));
    }
}
